<template>
	<view>
		<u-navbar back-text="返回" :title="article.title"></u-navbar>
		<view style="padding: 24rpx;">
			<text style="font-size: 36rpx; font-weight: bold; color: #212121;">{{article.title}}</text>
		</view>
		<view style="display: flex; padding:0rpx 24rpx; color: #bdbdbd;">
			<view style="width: 50%;"><u-icon name="clock" margin-right="18" :label="article.createtime" label-color="#bdbdbd"></u-icon></view>
			<view style="width: 50%; text-align: right;"><u-icon name="eye" margin-right="18" :label="article.click" label-color="#bdbdbd"></u-icon></view>
		</view>
		<view style="padding: 24rpx;">
			<u-parse :html="article.content" :tag-style="{p:'line-height:50rpx;'}"></u-parse>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id:'',
				article:{},
			}
		},
		onLoad(option){
			var that = this;
			this.id = option.id;
			uni.request({
				url: this.$unishow + 'api/marticle/view?id=' + this.id,
				method: 'GET',
				data: {},
				success: res => {
					that.article = res.data;
					
					//微信jssdk
					if (that.$wechat && that.$wechat.isWechat()) {
						that.$wechat.share({
							title: that.article.title,
							desc: "",
							img: that.article.cover_image,
						}, window.location.href, {});
					}
					
				},
				fail: () => {},
				complete: () => {}
			});
		},
		methods: {
			
		}
	}
</script>

<style>

</style>
